<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/webpage/include/taglib.jsp"%>
<html>
<head>
	<title>财务收支明细管理</title>
	<meta name="decorator" content="ani"/>
	<script type="text/javascript">
		var validateForm;
		var $table; // 父页面table表格id
		var $topIndex;//弹出窗口的 index
		function doSubmit(table, index){//回调函数，在编辑和保存动作时，供openDialog调用提交表单。
		  if(validateForm.form()){
			  $table = table;
			  $topIndex = index;
			  jp.loading();
			  $("#inputForm").submit();
			  return true;
		  }

		  return false;
		}

		$(document).ready(function() {
			validateForm = $("#inputForm").validate({
				submitHandler: function(form){
					jp.post("${ctx}/ap/detil/save",$('#inputForm').serialize(),function(data){
						if(data.success){
	                    	$table.bootstrapTable('refresh');
	                    	jp.success(data.msg);
	                    	jp.close($topIndex);//关闭dialog

	                    }else{
            	  			jp.error(data.msg);
	                    }
					})
				},
				errorContainer: "#messageBox",
				errorPlacement: function(error, element) {
					$("#messageBox").text("输入有误，请先更正。");
					if (element.is(":checkbox")||element.is(":radio")||element.parent().is(".input-append")){
						error.appendTo(element.parent().parent());
					} else {
						error.insertAfter(element);
					}
				}
			});
			
		});
	</script>
</head>
<body class="bg-white">
		<form:form id="inputForm" modelAttribute="detil" class="form-horizontal">
		<form:hidden path="id"/>
		<sys:message content="${message}"/>	
		<table class="table table-bordered" style="text-align: center;">
		   <tbody>
		   <tr><td colspan="2" style="background-color: grey;color: red;text-align: center">原始</td></tr>

		   <tr>
					<td class="width-35 active"><label class="pull-right">之前结余：</label></td>
					<td class="width-65" colspan="2">
						<form:input path="zqjy" htmlEscape="false"    class="form-control "/>
					</td>
				</tr>
				<tr><td colspan="2" style="background-color: grey;color: red;text-align: center">收入</td></tr>
				<tr>
					<td class="width-35 active"><label class="pull-right">备用金收入：</label></td>
					<td class="width-65">
						<form:input path="byjsr" htmlEscape="false"    class="form-control "/>
					</td>

				</tr>
				<tr>
					<td class="width-35 active"><label class="pull-right">信息费收入：</label></td>
					<td class="width-65">
						<form:input path="xxfsr" htmlEscape="false"    class="form-control "/>
					</td>
				</tr>
				<tr>
					<td class="width-35 active"><label class="pull-right">保险费收入：</label></td>
					<td class="width-65">
						<form:input path="bxfsr" htmlEscape="false"    class="form-control "/>
					</td>

				</tr>
				<tr>
					<td class="width-35 active"><label class="pull-right">日常收入：</label></td>
					<td class="width-65">
						<form:input path="rcsr" htmlEscape="false"    class="form-control "/>
					</td>
				</tr>
				<tr>
					<td class="width-35 active"><label class="pull-right">其它收入：</label></td>
					<td class="width-65">
						<form:input path="qtsr" htmlEscape="false"    class="form-control "/>
					</td>

				</tr>
				<tr><td colspan="2" style="background-color: grey;color: red;text-align: center">支出</td></tr>

				<tr>
					<td class="width-35 active"><label class="pull-right">预付款支出：</label></td>
					<td class="width-65">
						<form:input path="yfkzc" htmlEscape="false"    class="form-control "/>
					</td>
				</tr>
				<tr>
					<td class="width-35 active"><label class="pull-right">回执付款支出(含货到)：</label></td>
					<td class="width-65">
						<form:input path="hzfkzc" htmlEscape="false"    class="form-control "/>
					</td>

				</tr>
				<tr>
					<td class="width-35 active"><label class="pull-right">防护用品支出：</label></td>
					<td class="width-65">
						<form:input path="fhpzc" htmlEscape="false"    class="form-control "/>
					</td>
				</tr>
				<tr>
					<td class="width-35 active"><label class="pull-right">装卸费支出：</label></td>
					<td class="width-65">
						<form:input path="zxfzc" htmlEscape="false"    class="form-control "/>
					</td>

				</tr>
				<tr>
					<td class="width-35 active"><label class="pull-right">费用支出：</label></td>
					<td class="width-65">
						<form:input path="fyzc" htmlEscape="false"    class="form-control "/>
					</td>
				</tr>
				<tr>
					<td class="width-35 active"><label class="pull-right">其它支出：</label></td>
					<td class="width-65">
						<form:input path="qtzc" htmlEscape="false"    class="form-control "/>
					</td>

				</tr>
				<tr><td colspan="2" style="background-color: grey;color: red;text-align: center">结余</td></tr>

				<tr>
					<td class="width-35 active"><label class="pull-right">结余：</label></td>
					<td class="width-65">
						<form:input path="jy" htmlEscape="false"    class="form-control "/>
					</td>
				</tr>

		 	</tbody>
		</table>
	</form:form>
</body>
</html>